//
//  Auction_ContactCustomerService_View_Wx.m
//  ZITHER
//
//  Created by weixin on 2019/6/1.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Auction_ContactCustomerService_View_Wx.h"

@implementation Auction_ContactCustomerService_View_Wx

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addToKeyWindow];
    }
    return self;
}

-(void)show{
    [super show];
    [self addSubview:self.backView];
}


-(BaseView *)backView{
    if (!_backView) {
        _backView = [[BaseView alloc]initWithFrame:CGRectMake(0, kScreenH -kScreenW, kScreenW, kScreenH-kScreenW)];
        _backView.backgroundColor =  [UIColor whiteColor];
        
        [_backView setCornerRadiusWithRadius:10 isMasks:YES];
        [self addSubview:_backView];
        [_backView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self).offset(0);
            make.centerY.equalTo(self).offset(0);
            make.height.mas_equalTo((kScreenW-30)/345.0*377);
            make.width.mas_equalTo(kScreenW-30);
        }];
        [self setUI];
    }
    return _backView;
}

-(void)setUI{
    [self.backViewTop mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backView).offset(0);
        make.left.right.equalTo(self.backView).offset(0);
        make.height.mas_equalTo((kScreenW-30)/345.0*260);
    }];
    [self.backViewBottom mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backViewTop.mas_bottom).offset(-10);
        make.left.right.equalTo(self.backView).offset(0);
        make.bottom.equalTo(self.backView).offset(0);
    }];
    
    [self.CloseIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backViewTop).offset(10);
        make.right.equalTo(self.backViewTop).offset(-10);
        make.height.width.mas_equalTo(30);
    }];
    
    [self.QRCodePic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backViewTop).offset(20);
        make.centerX.equalTo(self.backViewTop).offset(0);
        make.height.width.mas_equalTo(150);
    }];
    
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.QRCodePic.mas_bottom).offset(15);
        make.centerX.equalTo(self.backViewTop).offset(0);
        make.height.mas_equalTo(18);
    }];
    [self.WechatNumb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.nameLab.mas_bottom).offset(5);
        make.centerX.equalTo(self.backViewTop).offset(0);
        make.height.mas_equalTo(18);
    }];
    [self.recommendLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.backViewBottom).offset(15);
        make.centerX.equalTo(self.backViewTop).offset(0);
        make.height.mas_equalTo(18);
    }];
    [self.keepQRCodePic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.recommendLab.mas_bottom).offset(20);
        make.centerX.equalTo(self.backViewTop).offset((kScreenW-30)/4.0);
        make.height.mas_equalTo(40);
        make.width.mas_equalTo((kScreenW-70)/2.0);

    }];
    [self.WechatcopyNumb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.recommendLab.mas_bottom).offset(20);
        make.centerX.equalTo(self.backViewTop).offset(-(kScreenW-30)/4.0);
        make.height.mas_equalTo(40);
        make.width.mas_equalTo((kScreenW-70)/2.0);
    }];
    
}


/**
 
 backView;
 backViewTop;

 CloseIcon;
 QRCodePic;

 nameLab;
 WechatNumb;
 
 recommendLab;
 
 keepQRCodePic;
 WechatcopyNumb;
 */


/* MARK: ================= 上面灰色手表信息部分 =================*/
-(BaseView *)backViewTop{
    if (!_backViewTop) {
        _backViewTop = [[BaseView alloc]initWithFrame:CGRectMake(0, kScreenH -400, kScreenW, kScreenH-400)];
        _backViewTop.backgroundColor = HexColor(0xf5f5f5);
        [_backViewTop setCornerRadiusWithRadius:10 isMasks:YES];
        [self.backView addSubview:_backViewTop];
    }
    return _backViewTop;
}

- (BaseView *)backViewBottom{
    if (!_backViewBottom) {
        _backViewBottom = [[BaseView alloc]initWithFrame:CGRectMake(0, kScreenH -400, kScreenW, kScreenH-400)];
        _backViewBottom.backgroundColor = [UIColor whiteColor];
        [self.backView addSubview:_backViewBottom];
    }
    return _backViewBottom;
}



-(BaseImageV *)CloseIcon{
    if (!_CloseIcon) {
        _CloseIcon= [BaseImageV initCustom:CGRectZero contentMode:2];
        _CloseIcon.image = [UIImage imageNamed:@"位置图标"];
        _CloseIcon.backgroundColor = [UIColor grayColor];
        [self.backViewTop addSubview:_CloseIcon];
    }
    return _CloseIcon;
}
-(BaseImageV *)QRCodePic{
    if (!_QRCodePic) {
        _QRCodePic= [BaseImageV initCustom:CGRectZero contentMode:2];
        _QRCodePic.image = [UIImage imageNamed:@"位置图标"];
        _QRCodePic.backgroundColor = [UIColor grayColor];
        [_QRCodePic setCornerRadiusWithRadius:8 isMasks:YES];
        [self.backViewTop addSubview:_QRCodePic];
    }
    return _QRCodePic;
}


-(BaseLab *)nameLab{
    if (!_nameLab) {
        _nameLab = [BaseLab initCustomLab:@"懂表帝客服" color:HexColor(0x030303) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:17]];
        _nameLab.backgroundColor = [UIColor clearColor];
        [self.backViewTop addSubview:_nameLab];
    }
    return _nameLab;
}

-(BaseLab *)WechatNumb{
    if (!_WechatNumb) {
        _WechatNumb = [BaseLab initCustomLab:@"微信号: 123123123" color:HexColor(0x030303) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        _WechatNumb.backgroundColor = [UIColor clearColor];
        [self.backViewTop addSubview:_WechatNumb];
    }
    return _WechatNumb;
}

-(BaseLab *)recommendLab{
    if (!_recommendLab) {
        _recommendLab = [BaseLab initCustomLab:@"获取交易指导，反馈交易问题" color:HexColor(0x030303) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:17]];
        _recommendLab.backgroundColor = [UIColor clearColor];
        [self.backViewBottom addSubview:_recommendLab];
    }
    return _recommendLab;
}



- (BaseBtn *)keepQRCodePic{
    if (!_keepQRCodePic) {
        _keepQRCodePic = [BaseBtn initCustomBtnImageAndTitles:@[@"保存二维码"] images:@[@"未知图标"] color:@[baseColorTheme]];
        _keepQRCodePic.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14];
        [_keepQRCodePic setBorderWithColor:baseColorTheme width:1];
        [_keepQRCodePic setCornerRadiusWithRadius:6 isMasks:YES];
        [self.backViewBottom addSubview:_keepQRCodePic];
    }
    return _keepQRCodePic;
}
- (BaseBtn *)WechatcopyNumb{
    if (!_WechatcopyNumb) {
        _WechatcopyNumb = [BaseBtn initCustomBtnImageAndTitles:@[@"复制微信号"] images:@[@"未知图标"] color:@[[UIColor whiteColor]]];
        _WechatcopyNumb.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:14];
        _WechatcopyNumb.backgroundColor = baseColorTheme;
        [_WechatcopyNumb setCornerRadiusWithRadius:6 isMasks:YES];
        [self.backViewBottom addSubview:_WechatcopyNumb];
    }
    return _WechatcopyNumb;
}

//
//-(BaseLab *)titleOfferLab{
//    if (!_titleOfferLab) {
//        _titleOfferLab = [BaseLab initCustomLab:@"   ¥531,111" color:HexColor(0xff6f6f) font:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
//        [_titleOfferLab setCornerRadiusWithRadius:6 isMasks:YES];
//        _titleOfferLab.backgroundColor = HexColor(0xf5f5f5);
//        [self.backViewBottom addSubview:_titleOfferLab];
//        _titleOfferLab.hidden = YES;
//    }
//    return _titleOfferLab;
//}
//
//- (BaseBtn *)done{
//    if (!_done) {
//        _done = [BaseBtn initCustomBtnTitlestype:@[@"确定"] color:@[[UIColor whiteColor]]];
//        _done.titleLabel.font = [UIFont fontWithName:@"PingFangSC-Regular" size:15];
//        _done.backgroundColor =  baseColorTheme;
//        [_done setCornerRadiusWithRadius:6 isMasks:YES];
//        [self.backViewBottom addSubview:_done];
//    }
//    return _done;
//}

@end
